Skip to content

Optimize WebDAV replacement writes - #647

Merged
larryrider merged 2 commits into
internxt:mainfrom
taglia:pr/webdav-replace-writes
Jul 28, 2026
Merged

Optimize WebDAV replacement writes#647
larryrider merged 2 commits into
internxt:mainfrom
taglia:pr/webdav-replace-writes

Conversation

@taglia

@taglia taglia commented Jul 26, 2026

Copy link
Copy Markdown

Summary

This updates WebDAV PUT replacement behavior to use Drive file replacement when an existing file is overwritten.

When a client uploads to an existing file path, the handler now uploads the new payload and calls the Drive replace endpoint. If replacement fails, it falls back to the previous delete-and-create behavior.

Why

WebDAV clients commonly create placeholder files and then immediately overwrite them with real content. Deleting the existing file before creating the replacement adds extra metadata operations and can slow down backup-style workloads.

Using replace-first behavior reduces that overhead while preserving the existing fallback path.

Behavior

  • Existing file + non-empty upload: use Drive replaceFile.
  • Replace failure: fall back to delete/create.
  • Existing file + zero-byte upload: keep delete/create behavior.
  • Existing folder at destination: still returns conflict.
  • Response codes remain unchanged: 201 for create, 204 for replace.

Tests

  • Added/updated PUT handler coverage for replace-first behavior.
  • Verified targeted auth/WebDAV tests locally.

@taglia
taglia requested a review from larryrider as a code owner July 26, 2026 10:46
@larryrider
larryrider merged commit 0712dc0 into internxt:main Jul 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants